<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:display="http://www.w3.org/1999/xhtml"
      xmlns:div.display="http://www.w3.org/1999/xhtml" xmlns:row.display="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>合规部审批-状况</title>

    <!-- Bootstrap Core CSS -->
    <link th:href="@{/vendor/bootstrap/css/bootstrap.min.css}" href="../static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link th:href="@{/vendor/metisMenu/metisMenu.min.css}" rel="stylesheet">

    <!-- Custom CSS -->
    <link th:href="@{/dist/css/sb-admin-2.css}" rel="stylesheet">

    <!-- Custom Fonts -->
    <link th:href="@{/vendor/font-awesome/css/font-awesome.min.css}" rel="stylesheet" type="text/css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>


<!-- Bootstrap Core JavaScript -->
    <script th:src="@{/vendor/jquery/jquery.min.js}" src="../static/vendor/jquery/jquery.min.js"></script>
    <script th:src="@{/vendor/bootstrap/js/bootstrap.min.js}"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script th:src="@{/vendor/metisMenu/metisMenu.min.js}"></script>

    <!-- Custom Theme JavaScript -->
    <script th:src="@{/dist/js/sb-admin-2.js}"></script>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script>
        function comDepSubmit(){
            $("#compDepApproval").submit();
            parent.location.reload();
        }
//        function approvalInfoSubmit() {
//            var userid = $("#userid").val();
//            alert(userid+"userid");
//            var loanid = $("#loanid").val();
//            alert(loanid+"loanid");
//            var stepcode = "合规部审批";
//            var result =$("#result").val();
//            var actiondate =getNowFormatDate();
//
//
//            $.ajax({
//                type: "POST",
//                url: "/approvalInfoSubmit",
//                contentType: "application/json",
//                data: JSON.stringify({
//                    userid: userid.toString(),
//                    loanid: loanid.toString(),
//                    stepcode:stepcode.toString(),
//                    result:result.toString(),
//                    actiondate:actiondate.toString()
//                }),
//                success: function (data) {
//                    alert("审批完成，自动刷新网页");
//                    $("#table_workflow").submit();
//
//                }
//            })
//        }
//
//        function getNowFormatDate() {
//            var date = new Date();
//            var seperator1 = "-";
//            var seperator2 = ":";
//            var month = date.getMonth() + 1;
//            var strDate = date.getDate();
//            if (month >= 1 && month <= 9) {
//                month = "0" + month;
//            }
//            if (strDate >= 0 && strDate <= 9) {
//                strDate = "0" + strDate;
//            }
//            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
//                + " " + date.getHours() + seperator2 + date.getMinutes()
//                + seperator2 + date.getSeconds();
//            return currentdate;
//        }
    </script>

</head>
<body>

<div  id ="workflow_record"  >
    <div class="col-lg-12" >
        <form   name="applyInfo" th:action="@{/compDepApprovalInfo(loanid=${loanid},userid=${userid})}"  method="post"  >
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <div class="row">
                            <div class="col-lg-6">
                                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">工作流程记录</a>
                                <button type="submit" class="btn btn-primary">刷 新</button>
                                <button type="button" class="btn btn-primary">取消贷款</button>
                            </div>
                            <div class="col-lg-3">
                                <lable>当前步骤：合规部确认</lable>
                            </div>
                            <div class="col-lg-3">
                                <lable>工作流状态：运行中</lable>
                            </div>
                        </div>
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div class="row" >
                            <div class="tableinfo">
                                <table  class="table" border="1" >
                                    <tr>
                                        <th>日期</th>
                                        <th>用户</th>
                                        <th>步骤</th>
                                    </tr>
                                    <tr th:each="WorkFlow : ${applyInfo_info.Workflow}">
                                        <td th:text="${WorkFlow.ACTIONDATE}"></td>
                                        <td th:text="${WorkFlow.ACTIONUSER}"></td>
                                        <td th:text="${WorkFlow.STEPCODE}"></td>
                                    </tr>
                                </table>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="col-lg-12">
    <form id="compDepApproval" th:action="@{/compDepApprovalInfo(loanid=${loanid},userid=${userid})}" th:object="${compDepApproval_entity}" method="post"  >
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">合规部确认</a>
                    <button type="button" class="btn btn-primary" onclick="comDepSubmit()">提 交</button>
                </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse in">
                <div class="panel-body">
                    <div class="row" >
                        <div class="col-lg-2">
                            <label >被申请贷款的银行：</label>
                        </div>
                        <div class="col-lg-4">
                            <input type="text" style="border: none" th:field="*{bankcode}" id="bankcode" name="bankcode" class="form-control" >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >当前处理申请的银行：</label>
                        </div>
                        <div class="col-lg-4">
                            <input  id="branch" type="text" style="border: none" th:field="*{branch}" name="branch" class="form-control" >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >申请金额：</label>
                        </div>
                        <div class="col-lg-4">
                            <input id="drawamt"  type="text" style="border: none" th:field="*{drawamt}" name="drawamt" class="form-control" >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >申请金额币种：</label>
                        </div>
                        <div class="col-lg-4">
                            <input id="drawccy"  type="text" style="border: none" th:field="*{drawccy}" name="drawccy" class="form-control" >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >优先级：</label>
                        </div>
                        <div class="col-lg-4">
                            <select class="form-control" selected="" required>
                                <option value="1">正常</option>
                                <option value="2">最低</option>
                                <option value="3">最高</option>
                            </select>
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >审核结果：</label>
                        </div>
                        <div class="col-lg-4">
                            <select class="form-control" selected="" th:field="*{Result}" required>
                                <option value="">请选择</option>
                                <option value="1">退回客户经理修改贷款数据</option>
                                <option value="2">审批通过</option>
                                <option value="3">额度审核通过</option>
                                <option value="4">额度审核退回</option>
                            </select>
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >合规审查员：</label>
                        </div>
                        <div class="col-lg-4">
                            <input id="ActionUserName"  type="text" th:field="*{ActionUserName}" name="ActionUserName" class="form-control" >
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >合规审查初审意见：</label>
                        </div>
                        <div class="col-lg-4">
                            <textarea id="WorkItemTitle"  type="text" th:field="*{WorkItemTitle}" name="WorkItemTitle" class="form-control" ></textarea>
                        </div>
                    </div>

                    <div class="row" >
                        <div class="col-lg-2">
                            <label >合规审查复审意见：</label>
                        </div>
                        <div class="col-lg-4">
                            <textarea id="AuditContext"  type="text" th:field="*{AuditContext}" name="AuditContext" class="form-control" ></textarea>
                        </div>
                    </div>

                    <div class="row" >
                        <input th:value="${userid}" id="userid" style="display: none">
                        <input th:value="${loanid}" id="loanid" style="display: none">
                    </div>

                </div>
            </div>
        </div>
    </form>
</div>




</body>
</html>